home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / EXTRACT.HDR < prev    next >
Text File  |  1994-04-25  |  2KB  |  56 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _Extract( cStr, cDelim, nOccurance ) --> cString
  8.  
  9. PARAMETERS:
  10.  
  11. cStr       : String to extract characters from
  12. cDelim     : The delimiter character or string
  13. nOccurance : The nth occurance to extract
  14.  
  15. SHORT:
  16.  
  17. Extract nth occurance of delimited string from another string.
  18.  
  19. DESCRIPTION:
  20.  
  21. _Extract() will extract from cStr the nth string (specified in nOccurance)
  22. delimited with the specified delimiter (specified in cDelim).
  23.  
  24. END OF STRING ALWAYS = DELIMIT CHAR
  25.  
  26. The end of the string will always count as a match of the delimiter
  27. character.  That is, the string delimited by the 4th occurance of the
  28. delimiter "/" in the following string is "FOUR" even though there is no
  29. actual fourth occurance of the forward slash:
  30.  
  31. _Extract("ONE/TWO/THREE/FOUR", '/', 4)
  32.  
  33. The FIRST occurance of the delimiter character delimits "ONE", the second
  34. "TWO" etc etc.
  35.  
  36. NOTE:
  37.  
  38. The FIRST delimited text cannot be empty(),
  39.  
  40. i.e. _Extract('A-B-C-D', '-', 3) will work
  41. i.e. _Extract('-B-C-D', '-', 3)  will NOT work
  42.  
  43. Make sure there is no leading delimiter character in the string you
  44. are testing as in the above case ",B,C,..."
  45.  
  46. EXAMPLE:
  47.  
  48. To extract the THIRD number in a series of numbers in a character
  49. string delimited with commas:
  50.  
  51. t = _Exctract('12,34,56,74',',',3)
  52.  
  53. Result: t = 56
  54.  
  55. ******************************************************************************/
  56.